<?php

require 'orm/om/BaseUserPeer.php';


/**
 * Skeleton subclass for performing query and update operations on the 'user' table.
 *
 *
 *
 * You should add additional methods to this class to meet the
 * application requirements.  This class will only be generated as
 * long as it does not already exist in the output directory.
 *
 * @package    orm
 */
class UserPeer extends BaseUserPeer {


	/**
	 *
	 * Function to check whether the users credentials has been attached with the account or not
	 *
	 * Enter description here ...
	 * @param unknown_type $userId
	 */
	public static function isFBUser($userId){

		$oUser = UserPeer::retrieveByPK($userId);
		if($oUser->getFbId() != ""){
			return true;
		}else{
			return false;
		}


	}

	public static function isAdminUser($oUser){

		$role = $oUser->getRole();

		if($role->getName() == 'admin'){
			return TRUE;
		}else{
			return FALSE;
		}

	}

} // UserPeer
